package com.iss.okair.db.mapper.transsql;

import com.iss.okair.db.entity.AssetsTranUse;
import com.iss.okair.db.entity.Assetstrans;
import org.apache.ibatis.jdbc.SQL;

public class FinalTransCheckoutSQL {
 public String selectout(AssetsTranUse model){
     return new SQL(){
         {
             SELECT("*");
             FROM("checkoutlist c JOIN assets_finance f on c.assetsCode= f.assetsCode");
             if (model.getAssetsnamecn()!=null && !model.getAssetsnamecn().isEmpty()) {
                 WHERE("assetsnamecn like '%"+model.getAssetsnamecn()+"%'");
             }
             if (model.getBatchno()!=null && !model.getBatchno().isEmpty()) {
                 WHERE("batchno like '%"+model.getBatchno()+"%'");
             }
         }
     }.toString();
 }
}

